package com.rainbow.security.service.impl

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
import com.rainbow.common.UserUtils
import com.rainbow.security.entity.Menu
import com.rainbow.security.mapper.MenuMapper
import com.rainbow.security.service.MenuService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

@Service
class MenuServiceImpl : MenuService, ServiceImpl<MenuMapper, Menu>() {


    override fun getAllMenu(): List<Menu>? {
        return baseMapper.getAllMenu()
    }

    override fun getMenusByHrId(): List<Menu>? {
        return baseMapper.getMenusByHrId(UserUtils.getCurrentHr().id!!)
    }

    override fun menuTree(): List<Menu>? {
        return baseMapper.menuTree()
    }

    override fun getMenusByRid(id: Long): List<Long>? {
        return baseMapper.getMenusByRid(id)
    }
}